<?php
	$name = $_GET['name'];
	$password = $_GET['password'];
	
	$dbhost = 'localhost';
	$dbuser = 'root';
	$dbpass = 'root';
	$database = 'sb';
	
	$conn = mysqli_connect($dbhost,$dbuser,$dbpass,$database);
	if(!$conn){
		exit('数据库连接失败');
	}
	
	$sql = "SELECT*FROM lm WHERE name='$name' AND password='$password'";
	
	$retval = mysqli_query($conn,$sql);
	
	$row = mysqli_fetch_row($retval);
	
	if($row == '') {
		header("Location:./try021.html");
	}else{
		header("Location:./index2.html");
	}
	
	if(!$retval)
	{
			exit("数据不行:" . mysqli_error($conn));
	}
 ?>